package com.hbnu.controller;

import com.hbnu.pojo.Goods;
import com.hbnu.service.GoodsService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController//表示返回的是我们的数据
//下面一行代码可有可无
@RequestMapping("/goods")
public class GoodsController {
    @Resource
    private GoodsService goodsService;

    //方法上的RequestMapping必须要写
    @RequestMapping("/findAllGoods")
    public List<Goods> findAllGoods() {
        return goodsService.findAllGoods();
    }

}
